package com.sqx.modules.goods.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.goods.entity.Goods;
import com.sqx.modules.goods.entity.GoodsClassify;
import com.sqx.modules.goods.entity.GoodsShop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GoodsDao extends BaseMapper<Goods> {

    List<Goods> selectGoodsClassifyList(@Param("shopId") Long shopId);

    GoodsClassify selectClassify(@Param("classifyId") Integer classifyId);

    IPage<GoodsShop> selectShortShop(Page<GoodsShop> pages, @Param("lng") double lng, @Param("lat") double lat, @Param("shopName") String shopName, @Param("shopId") Long shopId);

    IPage<GoodsClassify> selectAllClassify(Page<GoodsClassify> page,String shopName, Long shopId);

    List<GoodsClassify> selectAllClassifyList(String shopName, Long shopId);

    int shopAddGoods(@Param("shopId") Long shopId,@Param("goodsIdList") List goodsIdList);

    List<Goods> selectGoodsByClassify(@Param("classifyId") Integer classifyId, @Param("shopId") Long shopId);

    List<Goods> selectGoodsBySales(Long shopId);

    List<Goods> selectGoodsBySalesAndGoodsName(Long shopId,String goodsName);

    List<Goods> selectGoodsBySalesAndGoodsNameAndShopIds(@Param("shopIdList") List<Long> shopIdList,@Param("goodsName") String goodsName);

    Goods selectGoodsById(Long goodsId);

}
